<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<link th:href="@{/staticlib/bootstrap-3.3.7-dist/css/bootstrap.min.css}" rel="stylesheet"></link>
<meta charset="UTF-8"></meta>
<title>Title</title>
</head>
<body>
	<div class="container">
		<span shiro:authenticated="true"> <span>欢迎您：</span></span>
		<div class="row">
			<div class="col-md-2">
			<div class="list-group">
			<a id="view" type="button" class="list-group-item active"><i class="glyphicon glyphicon-chevron-right"></i>用户列表</a>
			<a id="add" type="button" class="list-group-item"><i class="glyphicon glyphicon-chevron-right"></i> 添加用户</a>
			<a id="update" type="button" class="list-group-item"><i class="glyphicon glyphicon-chevron-right"></i>更新用户</a>
			<a id="del"  type="button" class="list-group-item"><i class="glyphicon glyphicon-chevron-right"></i>删除用户</a>
			<a href="logout" class="list-group-item"><i class="glyphicon glyphicon-chevron-right"></i>安全退出</a>
			</div>
			<div class="list-group">
			<a id="view1" href="userInfo/view" type="button" class="list-group-item active"><i class="glyphicon glyphicon-chevron-right"></i>用户列表</a>
			<a id="add1" href="userInfo/add" type="button" class="list-group-item"><i class="glyphicon glyphicon-chevron-right"></i> 添加用户</a>
			<a id="update1" href="userInfo/update" type="button" class="list-group-item"><i class="glyphicon glyphicon-chevron-right"></i>更新用户</a>
			<a id="del1"  href="userInfo/del" type="button" class="list-group-item"><i class="glyphicon glyphicon-chevron-right"></i>删除用户</a>
			<a href="logout" class="list-group-item"><i class="glyphicon glyphicon-chevron-right"></i>安全退出</a>
			</div>
			
			
			</div>
			<div class="col-md-10">
				<div class="row" id="premissionName">
					<h2>权限管理</h2>
				</div>
				<hr></hr>
				<div class="row" id="premissionValue"></div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript" th:src="@{/staticlib/js/jquery-1.12.4.min.js}"></script>
<script	type="text/javascript" th:src="@{/staticlib/bootstrap-3.3.7-dist/js/bootstrap.min.js}"></script>
<script type="text/javascript">

	$("#view").click(function(){
		//var tital = $("#userInfo:view").text();
		get("userInfo/view");
	});
	$("#add").click(function(){
		get("userInfo/add");
	});
	$("#update").click(function(){
		get("userInfo/update");
	});
	$("#del").click(function(){
		get("userInfo/del");
	});
	
	function get(url){
		$.ajax({
			url: "http://localhost:8080/" + url,
			type: "GET",
			success: function(result){
				console.log("==>" + JSON.stringify(result));
				
				if(result.login_status == 400){
					layer.msg(result.message);//当前用户没有登录！
				}else{
					$("#premissionValue").empty();
					$("<p></p>").append(result.data.view).appendTo("#premissionValue");
				}
			}
		});
	}
	
</script>
</html>